<body>
<p>Annotations for filtering test classes and methods.</P>

<p>In order to enable test filtering, you must use the <a href="FilteringRunner.html">FilteringRunning</a>, a
custom <a href="http://junit.org/junit/javadoc/4.5/org/junit/runner/Runner.html">JUnit 4 Runner</a>. To do so,
simply annotate your JUnit 4 test class like so:
<pre>
&#64;RunWith(FilteringRunner.class)
public void MySampleTest {
    ....
}
</pre>
<p>To categorize a particular test class or method, use the <a href="Type.html">Type</a> annotation.</p>

<p>If the <code>Type</code> annotation is applied at the class level, then that test type applies to all
test methods on that class. For example, given the following:
<pre>
&#64;RunWith(FilteringRunner.class)
&#64;Type(TestType.INTEGRATION)
public void MySampleTest {

    &#64;Test
    public void testSomething() { ... }

    &#64;Test
    public void testSomethingElse() { ... }
}
</pre>
both tests methods will be run as integration tests. You can also annotate test methods like so:
<pre>
&#64;RunWith(FilteringRunner.class)
public void MySampleTest {

    &#64;Test
    &#64;Type(TestType.INTEGRATION)
    public void testSomething() { ... }

    &#64;Test
    &#64;Type(TestType.INTEGRATION)
    public void testSomethingElse() { ... }
}
</pre>
This is effectively the same as the previous example, except instead of annotating the entire class, we annotated
each method. In this scenario, you would probably want to use the class leven annotation, since it is more concise.
However, if you use both class and method level annotations, the method level annotation will take precedence. So,
in the following example.
<pre>
&#64;RunWith(FilteringRunner.class)
&#64;Type(TestType.UNIT)
public void MyMostlyFastTest {

    &#64;Test
    public void testQuickly() { ... }

    &#64;Test
    public void testQuicklyAgain() { ... }

    &#64;Test
    &#64;Type(TestType.SLOW)
    public void testSlowly() { ... }
}
</pre>
The first two methods will be categorized as unit tests, where the third test will be categorized as a slow test.

<p>The <code>Type</code> annotation can also be omitted. If there is no <code>Type</code>, then the type is assumed
to be "unit". So, this following code is effectively the same as the previous code:
<pre>
&#64;RunWith(FilteringRunner.class)
public void MyMostlyFastTest {

    &#64;Test
    public void testQuickly() { ... }

    &#64;Test
    public void testQuicklyAgain() { ... }

    &#64;Test
    &#64;Type(TestType.SLOW)
    public void testSlowly() { ... }
}
</pre>

Notice that in all of the example used the <a href="FilteringRunner.html">TestType</a> enum in conjunction with the
Type annotation. This is more for convenience and is not required. The Type annotation also

<p>The actual triggering of the filtering is done through the system property
<code>org.infinitest.filter.types</code>The value of this property should be a comma or space separated list of test
types that should be executed. The matching of the test types is not case sensitive. So, if you run tests with
the configuration:</p>
<pre>
-Dorg.infinitest.filter.types=integration,functional
</pre>
<p>all tests annotated as "integration" or "functional" will be executed. All others will be ignored. Of course, this
only applies to tests that have the appropriate <code>RunWith</code> annotation; all tests that are not run with the
<code>FilteringRunning</code> will also be run.</p>
</body>